home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Dev / gcc263-readme.lha / GCC-Install next >
Text File  |  1994-12-11  |  15KB  |  448 lines

  1. ;;; -*- Lisp-Interaction -*-      ;;;  Version: 05-Dec-94    ;;;
  2. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;;;
  4. ;;;  GNU C Installation script for AmigaDOS
  5. ;;;
  6. ;;;  This program is free software; you can redistribute it and/or modify
  7. ;;;  it under the terms of the GNU General Public License as published by
  8. ;;;  the Free Software Foundation; either version 2 of the License, or
  9. ;;;  (at your option) any later version.
  10. ;;;
  11. ;;;  This program is distributed in the hope that it will be useful,
  12. ;;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ;;;  GNU General Public License for more details.
  15. ;;;
  16. ;;;  You should have received a copy of the GNU General Public License
  17. ;;;  along with this program; if not, write to the Free Software
  18. ;;;  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. ;;;
  20. ;;;
  21. ;;;  Author:   Jochen Wiedmann
  22. ;;;     Am Eisteich 9
  23. ;;;     72555 Metzingen
  24. ;;;     Germany
  25. ;;;
  26. ;;;     Phone: (0049) +7123 / 14881
  27. ;;;     Internet: jochen.wiedmann@uni-tuebingen.de
  28. ;;;
  29. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  30.  
  31.  
  32. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  33. ;;;
  34. ;;;  Variable settings
  35. ;;;
  36. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  37. (set @GNUC-Version "2.6.0")
  38. (set @GNUC-Version-Short "gcc260")
  39.  
  40. (transcript "Installing AmigaDOS-GNU Version " @GNUC-Version "...")
  41.  
  42.  
  43. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  44. ;;;
  45. ;;;  Check, if we are running OS2.04 or higher
  46. ;;;
  47. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  48. (set ver (/ (getversion "exec.library" (resident)) 65536))
  49. (if (< ver 37)
  50.     (abort "Sorry, gcc needs Kickstart/Workbench 2.04 or higher.")
  51. )
  52.  
  53.  
  54. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  55. ;;;
  56. ;;;  Startup message
  57. ;;;
  58. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  59. (message "GNU C:    The GNU Project C and C++ Compiler\n\n"
  60.     "V" @GNUC-Version "    © 1994 Free Software Foundation  \n\n"
  61.     "This program is FREE SOFTWARE; you can redistribute it and/or "
  62.     "modify it under the terms of the GNU General Public License as "
  63.     "published by the Free Software Foundation; either version 2 "
  64.     "or any later version.\n\n"
  65.     "This program is distributed in the hope that it will be useful, "
  66.     "but WITHOUT ANY WARRANTY! See the GNU General Public License "
  67.     "(in the file COPYING) for details."
  68. )
  69.  
  70.  
  71. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  72. ;;;
  73. ;;;  Check, if GNU: or GCC: already exists.
  74. ;;;
  75. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  76. (if (<> "" (getassign "GNU" "vad"))
  77.     (   (set @GNUC-installed-Dir (getassign "GNU" "vad"))
  78.     (set @default-dest (pathonly @GNUC-installed-Dir))
  79.     (set @GNUC-installed 1)
  80. )
  81. (   (if (<> "" (getassign "GCC" "vad"))
  82.     (   (set @GNUC-installed-Dir (getassign "GCC" "vad"))
  83.     (set @default-dest (pathonly @GNUC-installed-Dir))
  84.     (set @GNUC-installed 1)
  85.     )
  86.     (   (set @default-dest "SYS:")
  87.     (set @GNUC-installed 0)
  88.     ))
  89. ))
  90.  
  91.  
  92. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  93. ;;;
  94. ;;;  Let the user select a place for "GNU:"
  95. ;;;
  96. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  97. (message "GNU C is completely installed in one directory called GNU. "
  98.     "Typical places are Work:GNU or similar."
  99.     "\n\nWe start with selecting the parent directory of GNU, "
  100.     "so that I can unarchive the LhA files to this place."
  101.     "\nAn assign GNU: will lead to this directory later, binaries "
  102.     "will be in GNU:bin, link libraries in GNU:lib and so on."
  103.     "\n\nIf you have any problems with this installation script, send "
  104.     "mail to"
  105.     "\njochen.wiedmann@zdv.uni-tuebingen.de"
  106. )
  107. (set @GNU-dir-Parent (askdir
  108.     (prompt "Please select the directory the installation directory. "
  109.         "(A subdirectory GNU will be created.)"
  110.     )
  111.     (help "GNU C is installed in a directory called `GNU:'. For "
  112.       "example, binaries go into `GNU:bin', link libraries in "
  113.       "`GNU:lib' and so on.\n\n"
  114.       "A typical place is something like `Work:GNU' or something "
  115.       "similar. In this example you should select the directory "
  116.       "`Work:'.\n\n"
  117.       @askdir-help)
  118.     (default @default-dest)
  119.     (newpath)
  120. ))
  121. (set @GNU-dir (tackon @GNU-dir-Parent "GNU"))
  122. (complete 5)
  123.  
  124.  
  125. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  126. ;;;
  127. ;;;  Deinstall previous GNU C versions.
  128. ;;;
  129. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  130. (procedure Delete-File
  131. (   (if (exists Delete-File-Name)
  132.     (   (run ("C:Delete %s ALL QUIET FORCE" Delete-File-Name)
  133.          (prompt ("\n\nDeleting %s ..." Delete-File-Name))
  134.     )
  135.     ))
  136. ))
  137.  
  138. (if @GNUC-installed
  139. (   (set @GNU-installed-LibDir (tackon @GNU-dir "lib/gcc-lib"))
  140.     (if (patmatch @GNU-dir @GNUC-installed-Dir)
  141.     (   (if (exists @GNU-installed-LibDir)
  142.     (   (if (askbool
  143.             (prompt "\nYou seem to have installed a previous version "
  144.                 "of GNU C in `" @GNUC-installed-Dir "'."
  145.                 "\n\nShould I deinstall it? (Delete directory "
  146.                 (tackon @GNU-dir "lib/gcc-lib") "?"
  147.             )
  148.             (help "`GNU:' or `GCC:' is already assigned to `"
  149.               @GNUC-installed-Dir "'. "
  150.               "I suppose that this directory contains a previous "
  151.               "version of GNU C. Most files and directories are just "
  152.               "overwritten in what follows except for `"
  153.               @GNU-installed-LibDir "'."
  154.               "\n\nYou might wish to delete this directory now "
  155.               "in order to safe disk space."
  156.               "\n\n"
  157.               @askbool-help
  158.             )
  159.             (default 1)
  160.         )
  161.         (   (set Delete-File-Name @GNU-installed-LibDir)
  162.         (Delete-File)
  163.         (set Delete-File-Name (tackon @GNU-dir "lib/libamiga.a"))
  164.         (Delete-File)
  165.         (set Delete-File-Name (tackon @GNU-dir "lib/libb/libamiga.a"))
  166.         (Delete-File)
  167.         ))
  168.     ))
  169.     )
  170.     (   (if (askbool
  171.         (prompt "\nYou seem to have installed a previous version "
  172.             "of GNU C in `" @GNUC-installed-Dir "'."
  173.             "\n\nShould I delete this directory?"
  174.         )
  175.         (help "GNU: or GCC: is already assigned to `"
  176.               @GNUC-installed-Dir "'. "
  177.               "I suppose that this directory contains a previous "
  178.               "version of GNU C."
  179.               "\n\nIf this is true, you might delete it now in "
  180.               "order to safe disk space."
  181.               "\n\n" @askbool-help
  182.         )
  183.         (default 1)
  184.         )
  185.     (   (set Delete-File-Name (tackon @GNUC-installed-Dir "#?"))
  186.         (Delete-File)
  187.         (message "\nOk, I have deleted all subdirectories and files "
  188.              "in " @GNUC-installed-Dir "."
  189.              "\n\nNote, that I cannot remove `" @GNUC-installed-Dir
  190.              "'itself, because the assign `GNU:' is still valid."
  191.              "\n\nYou should do this manually."
  192.         )
  193.     ))
  194.     ))
  195. ))
  196. (complete 10)
  197.  
  198.  
  199. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  200. ;;;
  201. ;;;  Let the user decide, if the script should unarchive.
  202. ;;;
  203. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  204. (if (askbool
  205.     (prompt "\n\nShould I unpack the archives for you?")
  206.     (help "GNU C is distributed in different archives. These "
  207.           "must be unpacked using the program LhA. We'll do "
  208.           "this now in case you didn't already."
  209.     )
  210.     (default 1)
  211.     )
  212. (   (complete 15)
  213.     (set @loop 1)
  214.     (while @loop
  215.     (   (set LHA-PROG (askfile
  216.         (prompt "Please select your LhA program.")
  217.         (help "Unfortunately the Installer program ignores "
  218.           "your path settings. Thus I need to know the "
  219.           "complete path of your LhA program.\n\n"
  220.           @askfile-help
  221.         )
  222.         (default "C:")
  223.     ))
  224.     (if (exists LHA-PROG)
  225.     (   (set @loop 0)
  226.     ))
  227.     ))
  228.     (complete 20)
  229.  
  230.  
  231. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  232. ;;;
  233. ;;;  Let the user select, which parts of gcc should be installed.
  234. ;;;
  235. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  236.     (set @GNUC-packages (askoptions
  237.         (prompt "Which parts of gcc should be installed?")
  238.         (choices "Base distribution"
  239.              "Includes & Libraries"
  240.              "C"
  241.              "C++"
  242.              "Objective-C"
  243.              "Additional Utilities"
  244.              "On-line Documentation"
  245.              "Utilities On-line Documentation"
  246.              "Source Diffs"
  247.              "Documentation sources")
  248.         (default 71)
  249.         (help "gcc is distributed in different LhA archives. "
  250.           "I will unarchive those parts to " @GNU-Dir
  251.           " that you select.\n\n"
  252.           "A minimal installation requires base distribution, "
  253.           "Includes & Libraries and the C distribution. This will take "
  254.           "about 7.5 MB of harddisk space. However, I recommend at least "
  255.           "adding the on-line documentation, so you get a minimum of "
  256.           "10 MB.\n\n"
  257.           @askoptions-help)
  258.     )
  259.     )
  260.     (complete 25)
  261.  
  262.  
  263. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  264. ;;;
  265. ;;;  Ask the user, if he wants the 68020 binaries.
  266. ;;;
  267. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  268.     (set Install-020 "")
  269.     (if (AND (NOT (OR (= (database "cpu") "68000")
  270.               (= (database "cpu") "68010")
  271.          ))
  272.         (BITAND @GNUC-packages 30)
  273.     )
  274.     (   (if (askbool
  275.         (prompt "\n\nWould you like to have the 68020 binaries installed?")
  276.         (help "The GNU C distribution offers two different binary versions. "
  277.               "If your machine's CPU is a 68020 or above, then you should "
  278.               "install the 68020 binaries. (Note, that this doesn't affect "
  279.               "the binaries created by you.)\n\n"
  280.               "Otherwise you should select `No'.\n\n"
  281.               @askbool-help
  282.         )
  283.         (default 0)
  284.         )
  285.     (   (set Install-020 "-020")
  286.     ))
  287.     ))
  288.     (complete 30)
  289.  
  290.  
  291. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  292. ;;;
  293. ;;;  Unpack the archives
  294. ;;;
  295. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  296.     (set @Default-Archive-Path "")
  297.     (if (<> (substr @GNU-Dir-Parent (- (strlen @GNU-Dir-Parent) 1)) ":")
  298.     (   (set @GNU-Dir-Parent (cat @GNU-Dir-Parent "/"))
  299.     ))
  300.     (set LHA-COMMAND (cat LHA-PROG " x -q -I \"%s\" " @GNU-Dir-Parent))
  301.  
  302.     (procedure UnPack-Archive
  303.     (   (set @loop 1)
  304.     (while @loop
  305.     (   (set Install-Archive (askfile
  306.         (prompt ("Please select the archive file %s for unpacking."
  307.              Install-Archive-Name
  308.         ))
  309.         (help (cat ("Please select the archive file %s. "
  310.                 Install-Archive-Name)
  311.                "I will unpack this archive to " @GNU-Dir ".\n\n"
  312.                @askfile-help
  313.         ))
  314.         (default (tackon @Default-Archive-Path Install-Archive-Name))
  315.         ))
  316.         (set @Default-Archive-Path (pathonly Install-Archive))
  317.         (if (exists Install-Archive)
  318.         (   (set @loop 0)
  319.         (if (run (LHA-COMMAND Install-Archive)
  320.             (prompt ("\n\nUnpacking %s ..." Install-Archive))
  321.             )
  322.         (   (abort "\n\n" (LHA-COMMAND Install-Archive) "\n\nshowed an error.")
  323.         ))
  324.         )
  325.         (   (message "File " Install-Archive " does not exist.")
  326.         (set Install-Archive "")
  327.         ))
  328.     ))
  329.     ))
  330.  
  331.  
  332.     (set n 0)
  333.     (set complete-level 40)
  334.     (set bit 1)
  335.     (while (set Install-Archive-Name (select n
  336.         (cat @GNUC-Version-Short "-base.lha")
  337.         (cat @GNUC-Version-Short "-inclib" Install-020 ".lha")
  338.         (cat @GNUC-Version-Short "-c" Install-020 ".lha")
  339.         (cat @GNUC-Version-Short "-c++" Install-020 ".lha")
  340.         (cat @GNUC-Version-Short "-objc" Install-020 ".lha")
  341.         (cat @GNUC-Version-Short "-utils.lha")
  342.         (cat @GNUC-Version-Short "-doc.lha")
  343.         (cat @GNUC-Version-Short "-utilsdoc.lha")
  344.         (cat @GNUC-Version-Short "-diffs.lha")
  345.         (cat @GNUC-Version-Short "-texi.lha")
  346.         ""
  347.        ))
  348.     (   (if (BITAND @GNUC-packages bit)
  349.     (   (UnPack-Archive)
  350.     ))
  351.     (complete complete-level)
  352.     (set complete-level (+ complete-level 5))
  353.     (set bit (shiftleft bit 1))
  354.     (set n (+ n 1))
  355.     ))
  356. ))
  357. (complete 85)
  358.  
  359.  
  360. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  361. ;;;
  362. ;;;  Copying environment variables
  363. ;;;
  364. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  365. (if @GNUC-installed
  366. (   (copyfiles
  367.     (prompt "Installing environment variables in `ENVARC:' ...\n\n")
  368.     (help "You seem to have already installed GNU C.\n\n"
  369.           "If you have modified certain environment variables "
  370.           "like LESSCHARSET, PAGER or TERM, you might keep this "
  371.           "modifications instead of overwriting them with my "
  372.           "default values. In that case you should compare "
  373.           "`GNU:envarc' with `ENVARC:' manually.\n\n"
  374.           @copyfiles-help)
  375.     (confirm)
  376.     (source (tackon @GNU-Dir "envarc"))
  377.     (dest "ENVARC:")
  378.     (all)
  379.     )
  380. ))
  381. (complete 90)
  382.  
  383.  
  384. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  385. ;;;
  386. ;;;  Modifying s:User-Startup
  387. ;;;
  388. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  389. (startup "GNU stuff"
  390.     (command "Assign GNU: " @GNU-Dir "\n")
  391.     (command "Execute GNU:s/User-Startup\n")
  392.     (prompt "The following lines should be added to your s:User-Startup:\n\n"
  393.         "Assign GNU: " @GNU-Dir "\n"
  394.         "Execute GNU:s/User-Startup\n\n"
  395.         "Shall I do this now?"
  396.     )
  397.     (help "gcc needs a special environment, some assigns for example. "
  398.       "The easiest way to get this environment is to modify your "
  399.       "User-Startup file, so that it is created automatically when "
  400.       "your machine boots.\n\n"
  401.       @startup-help
  402.     )
  403. )
  404. (complete 95)
  405.  
  406.  
  407. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  408. ;;;
  409. ;;;  Creating needed Links
  410. ;;;
  411. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  412. (if (askbool
  413.     (prompt "\n\nSome files may be installed either as soft links "
  414.         "or copied."
  415.         "\n\nDo you want to use links?"
  416.     )
  417.     (help "\n\nAmigaDOS is still having problems with soft links. "
  418.           "Specifically the `Dir' and `List' commands don't know "
  419.           "them and show them as directories. (GNU ls, however, "
  420.           "is alright.) Thus you might prefer to copy files."
  421.           "\n\nOn the other hand soft links save disk space. "
  422.           "(Not very much.)"
  423.           @askbool-help
  424.     )
  425.     (default 0)
  426.     )
  427. (   (set MakeLink (cat "\"" (tackon @GNU-Dir "c/MakeLink") " SOFT FORCE\""))
  428. )
  429. (   (set MakeLink "\"C:Copy ALL QUIET\" COPY")
  430. ))
  431. (execute (cat (tackon @GNU-Dir "s/RestoreLinks") " " @GNU-Dir " " MakeLink)
  432.     (prompt "Creating Links ...")
  433. )
  434. (complete 100)
  435.  
  436.  
  437. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  438. ;;;
  439. ;;;  Done; tell the user to reboot.
  440. ;;;
  441. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  442. (message "Now you have to reboot to activate new environment.\n"
  443.      "In case of errors, problems or whatever, please contact me at:"
  444.      "\n\nemail: phb@colombo.telesys-innov.fr"
  445.      "\nfidonet: 2:320/104.21 Ramses The Amiga Flying BBS"
  446. )
  447.  
  448.